﻿<!-- Views/Admin/DeleteUser.cshtml -->
@model WebApplication1.Models.User

@{
    ViewBag.Title = "删除用户";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="container">
    <h2>删除用户</h2>
    <hr />

    <div class="alert alert-danger">
        <h4>确认删除以下用户？</h4>
        <p>此操作不可恢复！</p>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">用户信息</h3>
        </div>
        <div class="panel-body">
            <dl class="dl-horizontal">
                <dt>@Html.DisplayNameFor(model => model.UserId)</dt>
                <dd>@Html.DisplayFor(model => model.UserId)</dd>

                <dt>@Html.DisplayNameFor(model => model.Username)</dt>
                <dd>@Html.DisplayFor(model => model.Username)</dd>

                <dt>@Html.DisplayNameFor(model => model.FullName)</dt>
                <dd>@Html.DisplayFor(model => model.FullName)</dd>

                <dt>@Html.DisplayNameFor(model => model.Role)</dt>
                <dd>
                    @if (Model.Role == "Admin")
                    {
                        <span>管理员</span>
                    }
                    else
                    {
                        <span>员工</span>
                    }
                </dd>
            </dl>
        </div>
    </div>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <div class="form-actions no-color">
            <input type="submit" value="确认删除" class="btn btn-danger" />
            <a href="@Url.Action("Users", "Admin")" class="btn btn-default">取消</a>
        </div>
    }
</div>